]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
padOsd: Replace Gtk accelerator API usage with Mutter
authorBilal Elmoussaoui <bil.elmoussaoui@gmail.com>
Tue, 6 Dec 2022 12:38:48 +0000 (12:38 +0000)
committerBilal Elmoussaoui <belmouss@redhat.com>
Mon, 2 Jan 2023 12:26:49 +0000 (13:26 +0100)
In order to drop the direct dependency of GTK from Mutter in a Wayland
only build.
The consumer and the producer of the events must be Mutter

Depends on https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2407

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2575>

js/ui/padOsd.js

index e1e24f70cb62cba59dfea3f2a5ecfa993c001507..2442e98fcfd98188870626a42fd35eab7513cb21 100644 (file)
@@ -3,7 +3,7 @@
 
 const {
     Atk, Clutter, GDesktopEnums, Gio,
-    GLib, GObject, Gtk, Meta, Pango, Rsvg, St,
+    GLib, GObject, Meta, Pango, Rsvg, St,
 } = imports.gi;
 const Signals = imports.misc.signals;
 
@@ -104,10 +104,9 @@ var KeybindingEntry = GObject.registerClass({
         if (event.type() != Clutter.EventType.KEY_PRESS)
             return Clutter.EVENT_PROPAGATE;
 
-        let str = Gtk.accelerator_name_with_keycode(null,
-                                                    event.get_key_symbol(),
-                                                    event.get_key_code(),
-                                                    event.get_state());
+        const str = Meta.accelerator_name(
+            event.get_state(), event.get_key_symbol());
+
         this.set_text(str);
         this.emit('keybinding-edited', str);
         return Clutter.EVENT_STOP;